package com.zjw.service.impl;

import com.zjw.dao.ResultDao;
import com.zjw.dao.impl.ResultDaoImpl;
import com.zjw.service.ResultService;
import com.zjw.utils.ConnectionUtil;
import com.zjw.vo.StudentResultVo;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public class ResultServiceImpl implements ResultService {
    @Override
    public List<StudentResultVo> getResultByStudentNo(int studentNo) {
        Connection conn = ConnectionUtil.getConnection();
        ResultDao resultDao = new ResultDaoImpl(conn);
        List<StudentResultVo> list = null;
        try {
            list = resultDao.selectResultByStudentId(studentNo);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            ConnectionUtil.closeALL(null , null , conn);
        }
        return list;
    }
}
